//
//  TableShowLabelCellModel.swift
//  CooperSwift
//
//  Created by 计海峰 on 2022/1/17.
//

import UIKit

public class TableShowLabelCellModel : NSObject, PublicTableCellConfigProtocol, BindKeyProtocol {
    
    /// 默认
    public var model: Any?
    
    public var showByDefaultWay = true
    
    //  MARK: - 基础实现
    required public init(_ model: Any?) {
        self.model = model
    }
    
    public func cellCls() -> UITableViewCell.Type {
        return TableShowLabelCell.self
    }
    
    public typealias TargetType = UILabel
    
    // MARK: - 回调
    /// 单次
    public func once(_ lb: UILabel, cell: UITableViewCell) {
        if let viewControl = self.model as? ViewControlProtocol {
            lb.snp.updateConstraints { make in
                make.edges.equalToSuperview().inset(viewControl.padding)
            }
        }
    }
    
    /// 多次
    public func every(_ lb: UILabel, cell: UITableViewCell) {
        
    }
    
}
